import 'package:color_dart/RgbaColor.dart';
import 'package:flutter/material.dart';
import 'package:im_flutter_sdk_example/jsonserialize/company/data.dart';

class BasicCompanyInfo extends StatelessWidget {
  final CompanyInfo item;

  const BasicCompanyInfo({Key key, this.item}) : super(key: key);

  Widget buildItem(String title, String description) {
    return Padding(
      padding: const EdgeInsets.symmetric(vertical: 5),
      child: Row(
        children: [
          SizedBox(
              child: Text('$title',
                  style:
                      TextStyle(color: rgba(107, 107, 107, 1), fontSize: 14)),
              width: 80),
          Expanded(
              child: Text('$description',
                  style: TextStyle(color: rgba(68, 68, 68, 1), fontSize: 14),
                  maxLines: 20)),
        ],
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Container(
          padding: const EdgeInsets.symmetric(vertical: 0, horizontal: 15),
          color: Colors.white,
          child: Column(
            children: [
              buildItem('电话', '${item.baseTelephone ?? "暂无内容"}'),
              buildItem('邮箱', '${item.baseEmail ?? "暂无内容"}'),
              buildItem('官网', '${item.baseWww ?? "暂无内容"}'),
              buildItem('地址', '${item.baseRegisterAddress ?? "暂无内容"}'),
              buildItem('简介', '${item.intro ?? "暂无内容"}'),
              buildItem('经营', '${item.baseIndustry ?? "暂无内容"}'),
              buildItem('范围', '${item.industryTag ?? "暂无内容"}'),
            ],
          ),
        )
      ],
    );
  }
}
